package com.uetoken.cn.adapter;

import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.uetoken.cn.R;
import com.uetoken.cn.adapter.model.PurchaseDetailTableModel;
import com.uetoken.cn.manager.UEDataManager;

import butterknife.BindView;

public class PurchaseDetailAdapter extends BaseQuickAdapter<PurchaseDetailTableModel, BaseViewHolder> {


    private Context mContext;

    public PurchaseDetailAdapter(Context context) {
        super(R.layout.item_table_title, UEDataManager.getInstance().getPurchaseDetailTableList());
        this.mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, PurchaseDetailTableModel item) {
        helper.setVisible(R.id.stateTv, false);
        helper.setVisible(R.id.stateIv, true);

        helper.setBackgroundColor(R.id.tableStripLatout, ContextCompat.getColor(mContext, R.color.durban_White));
        helper.setImageResource(R.id.stateIv, item.getStateDra());
        helper.setText(R.id.currencyTv, item.getCurrencyUnit());
        helper.setText(R.id.quantityBtn, item.getQuantity());
        helper.setText(R.id.typeBtn, item.getType());
        helper.setText(R.id.timeBtn, item.getTime());
    }
}
